package nuonuo.com.view.app;

import android.app.Application;

import nuonuo.com.view.constant.Constant;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by n6 on 2017/3/13.
 */

public class MyApplication extends Application {
    private static Retrofit mRetrofit;

    @Override
    public void onCreate() {
        super.onCreate();
        mRetrofit = new Retrofit.Builder()
                .baseUrl(Constant.CC_HTTP)
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .build();
    }

    public static Retrofit getRetrofit(){
        return mRetrofit;
    }
}
